subroutine getuhf(icore,list, filename) 
use mod_symm
use mod_iop
use mod_size
use mod_orbit
use mod_ioff 
implicit none 
integer, intent(in) :: list
real*8, intent(in) :: icore(*)
real*8, allocatable :: itmp(:)
character(len=8),intent(in) :: filename
integer nva2, noa2, nvb2, nob2, nvab, noab, nvoa, nvob, nvaob, nvboa
!
nva2 = nva*(nva-1)/2
noa2 = noa*(noa-1)/2
nvb2 = nvb*(nvb-1)/2
nob2 = nob*(nob-1)/2
nvab = nva*nvb
noab = noa*nob
nvoa = nva*noa
nvob = nvb*nob
nvaob = nva*nob
nvboa = nvb*noa
!----------cc_int = 1 from cfour 
if(prec==8.and.cc_int/=3) then 
   call getallso(icore, list, filename)
elseif(prec==4.and.cc_int/=3) then 
   call getallso_s(icore, list, filename) 
!----------cc_int = 2 from amesp 
elseif(prec==8.and.cc_int==3) then 
   if(filename=='IJKLAA__') THEN 
!      call getamesp_int(icore, 1, noa2, noa2, 'OOOO__AA')     
       call getlst_nsym(icore, 1, noa2, 'OOOO__AA', & 
                noa, noa, 0, noa, noa, 0)
   elseif(filename=='IJKLAB__') THEN
!      call getamesp_int(icore, 1, noab, noab, 'OOOO__AB')     
       call getlst_nsym(icore, 1, noab, 'OOOO__AB', & 
                noa, nob, 1, noa, nob, 1)
   elseif(filename=='IJKLBB__') THEN 
!      call getamesp_int(icore, 1, nob2, nob2, 'OOOO__BB')     
       call getlst_nsym(icore, 1, nob2, 'OOOO__BB', & 
                nob, nob, 0, nob, nob, 0)
!------------IJKA was saved as KAIJ in amesp
   elseif(filename=='IJKAAA__') THEN 
      allocate(itmp(noa2*nvoa))
!      call getamesp_int(itmp, 1, noa2, nvoa, 'OOOV__AA')     
       call getlst_nsym(itmp, 1, noa2, 'OOOV__AA', & 
                noa, nva, 1, noa, noa, 0)
       call itranspso(itmp, icore, nva, noa, 1, noa, noa, 0, 1)
   elseif(filename=='IJKABB__') THEN 
      allocate(itmp(nob2*nvob))
!     call getamesp_int(itmp, 1, nob2, nvob, 'OOOV__BB')     
      call getlst_nsym(itmp, 1, nob2, 'OOOV__BB', & 
                nob, nvb, 1, nob, nob, 0)
      call itranspso(itmp, icore, nvb, nob, 1, nob, nob, 0, 1)
   elseif(filename=='IJKAAB__') THEN 
      allocate(itmp(noab*nvboa))
!     call getamesp_int(itmp, 1, noab, nvboa, 'OOOV__AB')     
      call getlst_nsym(itmp, 1, noab, 'OOOV__AB', & 
                noa, nvb, 1, noa, nob, 1)
      call itranspso(itmp, icore, nvb, noa, 1, noa, nob, 1, 1)
   elseif(filename=='IJKABA__') THEN 
      allocate(itmp(noab*nvaob))
!     call getamesp_int(itmp, 1, noab, nvaob, 'OOOV__BA')     
      call getlst_nsym(itmp, 1, noab, 'OOOV__BA', & 
                nob, nva, 1, nob, noa, 1)
      call itranspso(itmp, icore, nva, nob, 1, noa, nob, 1, 1)

   elseif(filename=='ABIJAA__') THEN 
!      call getamesp_int(icore, 1, noa2, nva2, 'VVOO__AA')     
      call getlst_nsym(icore, 1, noa2, 'VVOO__AA', & 
                nva, nva, 0, noa, noa, 0)
   elseif(filename=='ABIJAB__') THEN 
!      call getamesp_int(icore, 1, noab, nvab, 'VVOO__AB')     
      call getlst_nsym(icore, 1, noab, 'VVOO__AB', & 
                nva, nvb, 1, noa, nob, 1)
   elseif(filename=='ABIJBB__') THEN 
!      call getamesp_int(icore, 1, nob2, nvb2, 'VVOO__BB')     
      call getlst_nsym(icore, 1, nob2, 'VVOO__BB', & 
                nvb, nvb, 0, nob, nob, 0)

   elseif(filename=='BIAJAAAA') THEN 
!      call getamesp_int(icore, 1, nvoa, nvoa,   'OVVO__AA')     
      call getlst_nsym(icore, 1, nvoa, 'OVVO__AA', & 
                nva, noa, 1, nva, noa, 1)
   elseif(filename=='BIAJBBBB') THEN 
!      call getamesp_int(icore, 1, nvob, nvob,   'OVVO__BB')     
      call getlst_nsym(icore, 1, nvob, 'OVVO__BB', & 
                nvb, nob, 1, nvb, nob, 1)
   elseif(filename=='BIAJABAB') THEN 
!      call getamesp_int(icore, 1, nvaob, nvaob, 'OVVO__AB')     
      call getlst_nsym(icore, 1, nvaob, 'OVVO__AB', & 
                nva, nob, 1, nva, nob, 1)
   elseif(filename=='BIAJBABA') THEN 
!      call getamesp_int(icore, 1, nvboa, nvboa, 'OVVO__BA')     
      call getlst_nsym(icore, 1, nvboa, 'OVVO__BA', & 
                nvb, noa, 1, nvb, noa, 1)
   elseif(filename=='BIAJAABB') THEN 
!      call getamesp_int(icore, 1, nvob, nvoa,   'OVVOAABB')     
      call getlst_nsym(icore, 1, nvob, 'OVVOAABB', & 
                nva, noa, 1, nvb, nob, 1)

   elseif(filename=='ABCIAA__') THEN
!      call getamesp_int(icore, 1, nvoa, nva2,  'VVVO__AA') 
      call getlst_nsym(icore, 1, nvoa, 'VVVO__AA', & 
                nva, nva, 0, nva, noa, 1)
   elseif(filename=='ABCIAB__') THEN 
!     call getamesp_int(icore, 1, nvaob, nvab, 'VVVO__AB') 
      call getlst_nsym(icore, 1, nvaob, 'VVVO__AB', & 
                nva, nvb, 1, nva, nob, 1)
   elseif(filename=='ABCIBA__') THEN 
!     call getamesp_int(icore, 1, nvboa, nvab, 'VVVO__BA') 
      call getlst_nsym(icore, 1, nvboa, 'VVVO__BA', & 
                nvb, nva, 1, nvb, noa, 1)
   elseif(filename=='ABCIBB__') THEN 
!     call getamesp_int(icore, 1, nvob, nvb2,  'VVVO__BB') 
      call getlst_nsym(icore, 1, nvob, 'VVVO__BB', & 
                nvb, nvb, 0, nvb, nob, 1)

   elseif(filename=='ABCDAA__') THEN 
!      call getamesp_int(icore, 1, nva2, nva2,  'VVVV__AA') 
      call getlst_nsym(icore, 1, nva2, 'VVVV__AA', & 
                nva, nva, 0, nva, nva, 0)
   elseif(filename=='ABCDAB__') THEN 
!      call getamesp_int(icore, 1, nvab, nvab,  'VVVV__AB') 
      call getlst_nsym(icore, 1, nvab, 'VVVV__AB', & 
                nva, nvb, 1, nva, nvb, 1)
   elseif(filename=='ABCDBB__') THEN 
!     call getamesp_int(icore, 1, nvb2, nvb2,  'VVVV__BB') 
      call getlst_nsym(icore, 1, nvb2, 'VVVV__BB', & 
                nvb, nvb, 0, nvb, nvb, 0)
   endif
elseif(prec==4.and.cc_int==3) then 
   call getallso_s(icore, list, filename) 
else   
   write(6,*)'error in getuhf' 
   stop
endif
!
return
end
